package net.googlecode.vasetskiy.task3;

import java.math.BigDecimal;

/**
 * Created by IntelliJ IDEA.
 * User: Vasetskiy Vlad
 * Date: 29.03.11
 * Time: 14:00
 * To change this template use File | Settings | File Templates.
 */
public class SalaryApp {

    /**
     * Counts employees salary.
     *
     * @param args
     */
    public static void main(String[] args) {
        SalaryApp app = new SalaryApp();
         SalaryCalculator calc = new SalaryCalculator();
           calc.calcSalary(managerNotBonus());
           calc.calcSalary(managerBonus());
           calc.calcSalary(employeeBonus());
           calc.calcSalary(employeeNotBonus());
           calc.calcSalary(Bos());
    }

    /**
     * manager Not Bonus.
     *
     * @return Manager
     */
    public static Manager managerNotBonus() {
        Manager manager = new Manager("Ivan", "Ivanov");
        manager.setAge(30);
        manager.setPerHour(true);
        manager.setBonus(false);
        manager.setRate(new BigDecimal(25));

        return manager;
    }

    /**
     * manager Bonus.
     *
     * @return Manager
     */
    public static Manager managerBonus() {
        Manager manager = new Manager("Petr", "Petrov");
        manager.setAge(35);
        manager.setBonus(true);
        manager.setBonusAmount(new BigDecimal(1000));
        manager.setPerHour(false);
        manager.setRate(new BigDecimal(5000));

        return manager;
    }

    /**
     * employee Bonus.
     *
     * @return employee
     */
    public static Employee employeeBonus() {
        Employee employee = new Employee("Semen", "Semenov");
        employee.setAge(55);
        employee.setBonus(true);
        employee.setBonusAmount(new BigDecimal(1500));
        employee.setPerHour(true);
        employee.setRate(new BigDecimal(8));

        return employee;
    }

    /**
     * employee Not Bonus
     *
     * @return employee
     */
    public static Employee employeeNotBonus() {
        Employee employee = new Employee("Sergey", "Sergeev");
        employee.setAge(45);
        employee.setBonus(false);
        employee.setPerHour(false);
        employee.setExperience(15);
        employee.setRate(new BigDecimal(200));

        return employee;
    }

    /**
     * Boss.
     *
     * @return Boss
     */
    public static Director Bos() {
        Director boss = new Director("Pankrat", "Pankratovich");
        boss.setAge(55);
        boss.setRate(new BigDecimal(35));
        boss.setBonusAmount(new BigDecimal(2000));
        return boss;
    }



}
